﻿#region
using System;
using System.Collections.Generic;
using System.Linq;
using DevExpress.XtraEditors;
using DevTools.Properties;

#endregion

namespace DevTools.AndroidLayoutHelper
{
    public partial class ExcludeListControl : XtraUserControl
    {
        public ExcludeListControl()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (DesignMode)
                return;

            mmeList.Text = Settings.Default.AndroidLayoutHelper_ExcludeList;
        }

        public void UpdateSetting()
        {
            Settings.Default.AndroidLayoutHelper_ExcludeList = mmeList.Text;
        }

        public List<string> GetExcludeList()
        {
            var tokens = mmeList.Text.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
            return tokens.Select(x => x.Trim()).ToList();
        }
    }
}